package com.hzh.music;

import java.util.List;
import java.util.Map;

import javax.naming.spi.DirStateFactory.Result;

import com.google.common.collect.Maps;
import com.jfinal.core.Controller;

@SuppressWarnings("all")
public class MusicController extends Controller {

	
	
	public void getPlayList() {
		Map result = Maps.newHashMap();
		MusicService service = Net163MusicService.SERVICE;
		try {
			List<Music> list = service.getMusicList(this.getPara("listId"));
			result.put("result", "0");
			result.put("list", list);
			
		} catch (Exception e) {
			result.put("result", "-1");
			result.put("msg", e.getMessage());
			e.printStackTrace();
		}
		
		// 允许跨域
		this.getResponse().addHeader("Access-Control-Allow-Origin", "*");
		this.renderJson(result);
	}
}
